package com.example.demo.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.constants.pojo.UserRoleResultMap;
import com.example.demo.entity.UserEntity; 

public interface IUserMapper extends BaseMapper<UserEntity>{

	/**
	 * 
	 * @param page
	 * @param sex
	 * @return
	 */
	@Select("select t2.[id] ,t2.[user_name] ,t2.[name] ,t2.[sex] ,t3.id as roleId ,t3.[name] as role_name from [base_user_role] t1 inner join [base_user] t2 on t1.[user_id] = t2.[id] inner join [base_role] t3 on t1.[role_id] = t3.[id] where t2.sex=#{params.sex} ")
	List<Map<String, Object>> GetUserList(Page<Map<String,Object>> page,Map<String,Object> params);
	

    /**
     * 
     * @param page
     * @param params
     * @return
     */
	List<UserRoleResultMap> SelectUserRoleList(Page<UserRoleResultMap> page, Map<String,Object> params);
	
	
	/**
	 * 
	 * @param page
	 * @param params
	 * @return
	 */
	List<Map<String, Object>> QueryUserRoleList(Page<Map<String, Object>> page, Map<String,Object> params);
	
}
